/* --------------------------------------

A5_EuropeanUFR_yields.do

by: Kristy A.E. Jansen

This do-file: Yield effects European UFR in Jansen (2024) -- part 3
	1. Table 8
	2. Table IA9
	3. Table IA21

-------------------------------------- */

/* Initialization */
clear all
set more off
capture log clear _all

global root "~/RFS_replication"  // *** NEED TO CHANGE THIS TO CORRECT FILE PATH ***
global main_data $root/Data

/* Stata Packages */
*ssc install estout
*ssc install ftools
*ssc install reghdfe

/* Load Data */
use "$main_data/pseudo_data_part3_yields.dta", clear

/* ---------------------- Regressions ---------------------- */

display("Table 8: Effects of UFR at the European level")
estimates clear
qui: reghdfe spread_30y_20y  c.UFR_Europe##c.size_IC_proxy2 spread_10y_2y GGDEBT CDS ELDLYPOP, ///
noabsorb cluster(country2)
estimates store model1

qui: reghdfe spread_30y_20y c.UFR_Europe#c.size_IC_proxy2  spread_10y_2y GGDEBT CDS ELDLYPOP, ///
absorb(ym country2) cluster(country2)
estimates store model2

qui: reghdfe spread_20y_10y  c.UFR_Europe##c.size_IC_proxy2 spread_10y_2y GGDEBT CDS ELDLYPOP, ///
noabsorb cluster(country2)
estimates store model3

qui: reghdfe spread_20y_10y c.UFR_Europe#c.size_IC_proxy2  spread_10y_2y GGDEBT CDS ELDLYPOP, ///
absorb(ym country2) cluster(country2)
estimates store model4

qui: reghdfe spread_30y_10y  c.UFR_Europe##c.size_IC_proxy2 spread_10y_2y GGDEBT CDS ELDLYPOP, ///
noabsorb cluster(country2)
estimates store model5

qui: reghdfe spread_30y_10y c.UFR_Europe#c.size_IC_proxy2  spread_10y_2y GGDEBT CDS ELDLYPOP, ///
absorb(ym country2) cluster(country2)
estimates store model6

estfe  model*, labels(ym "Time FE" country2 "Country FE")
esttab model*, indicate(`r(indicate_fe)') ar2(3) b(4) t(2) star(* 0.10 ** 0.05 *** 0.01) ///
mlabels(30-20Y 30-20Y 20-10Y  20-10Y 30-10Y 30-10Y) varwidth(30) nogaps brackets 


display("Table IA9: Effects of UFR at the European level - alternative measure")
estimates clear
qui: reghdfe spread_30y_20y  c.UFR_Europe##c.size_IC_proxy spread_10y_2y GGDEBT CDS ELDLYPOP, ///
noabsorb cluster(country2)
estimates store model1

qui: reghdfe spread_30y_20y c.UFR_Europe#c.size_IC_proxy  spread_10y_2y GGDEBT CDS ELDLYPOP, ///
absorb(ym country2) cluster(country2)
estimates store model2

qui: reghdfe spread_20y_10y  c.UFR_Europe##c.size_IC_proxy spread_10y_2y GGDEBT CDS ELDLYPOP, ///
noabsorb cluster(country2)
estimates store model3

qui: reghdfe spread_20y_10y c.UFR_Europe#c.size_IC_proxy  spread_10y_2y GGDEBT CDS ELDLYPOP, ///
absorb(ym country2) cluster(country2)
estimates store model4

qui: reghdfe spread_30y_10y  c.UFR_Europe##c.size_IC_proxy spread_10y_2y GGDEBT CDS ELDLYPOP, ///
noabsorb cluster(country2)
estimates store model5

qui: reghdfe spread_30y_10y c.UFR_Europe#c.size_IC_proxy  spread_10y_2y GGDEBT CDS ELDLYPOP, ///
absorb(ym country2) cluster(country2)
estimates store model6

estfe  model*, labels(ym "Time FE" country2 "Country FE")
esttab model*, indicate(`r(indicate_fe)') ar2(3) b(4) t(2) star(* 0.10 ** 0.05 *** 0.01) ///
mlabels(30-20Y 30-20Y 20-10Y  20-10Y 30-10Y 30-10Y) varwidth(30) nogaps brackets 


display("Table IA21: Effects of UFR at the European level - transitionals")
foreach var of varlist dummy_trans* trans_cont {
	
	estimates clear
	qui: reghdfe spread_30y_20y c.UFR_Europe#c.size_IC_proxy2 c.UFR_Europe#c.size_IC_proxy2#c.`var' ///
	spread_10y_2y GGDEBT CDS ELDLYPOP, absorb(ym country2) cluster(country2)
	estimates store model1

	qui: reghdfe spread_20y_10y c.UFR_Europe#c.size_IC_proxy2 c.UFR_Europe#c.size_IC_proxy2#c.`var' ///
	spread_10y_2y GGDEBT CDS ELDLYPOP, absorb(ym country2) cluster(country2)
	estimates store model2

	qui: reghdfe spread_30y_10y c.UFR_Europe#c.size_IC_proxy2 c.UFR_Europe#c.size_IC_proxy2#c.`var' ///
	spread_10y_2y GGDEBT CDS ELDLYPOP, absorb(ym country2) cluster(country2)
	estimates store model3

	estfe  model*, labels(ym "Time FE" country2 "Country FE")
	esttab model*, indicate(`r(indicate_fe)') ar2(3) b(4) t(2) star(* 0.10 ** 0.05 *** 0.01) ///
	mlabels(30-20Y 20-10Y 30-10Y) varwidth(45) nogaps brackets 

}


